//This class stores and handles all the parameters associated
//with a task. It contains the following task parameters:

//1. Task Type
//2. Task Reference No.
//3. Title
//4. Date class
//5. 2 Time class
//6. Task Status

//The APIs that this class supports include:
//1. void setFloating(int setTaskRef, string setTitle);
//2. void setDeadline(int setTaskRef, string setTitle, int setDay, int setMonth, int setHour, int setMinute);
//3. void setMeeting(int setTaskRef, string setTitle, int setDay, int setMonth, int setStartHour, int setStartMinute, int setEndHour, int setEndMinute);
//4. void setTitle(string setTitle);
//5. void setDate(int setDay, int setMonth);
//6. void setStartTime(int setStartHour, int setStartMinute);
//7. void setEndTime(int setEndHour, int setEndMinute);
//8. void setTaskStatus(TaskStatus setTaskStatus);
//9. TaskType getTaskType() const;
//10. int getTaskRef() const;
//11. string getTitle() const;
//12. void getTaskDate(int &getDay, int &getMonth);
//13. Date getTaskDate() const;
//14. void getStartTime(int &getHour, int &getMinute);
//15. Time getStartTime() const;
//16. void getEndTime(int &getHour, int &getMinute);
//17. Time getEndTime() const;
//18. TaskStatus getTaskStatus();
//19. void updateTaskStatus();
//20. void markComplete();

#ifndef TASK_H_
#define TASK_H_

#include <qcoreapplication.h>
#include <qvector.h>
#include <string>
#include <assert.h>
#include <qdatetime.h>
#include "InvalidInputException.h"

using namespace std;

class Task {
public:
	//Enum structs for various task components
	enum TaskType {
		FLOATING, DEADLINE, MEETING, EVENT
	};

	enum TaskStatus {
		COMPLETE, NORMAL, APPROACH3, APPROACH2, APPROACH1, OVERDUE
	};

private:
	//Task variables
	TaskType type;
	int taskRef;
	QString title;
	QDateTime start;
	QDateTime end;
	TaskStatus taskStatus;
	QVector<QString> tags;

	//Functions that support the updating of task status variables
	TaskStatus compareTime();
		
public:
	Task::Task();

	//Setters for initializing different task types
	void setTask(int setTaskRef, QString setTitle, QDateTime setStart, QDateTime setEnd,
				 QVector<QString> setTags);

	//Setters for different task parameters
	void setTitle(QString setTitle);
	void setStartDate(QDate setStartDate);
	void setEndDate(QDate setEndDate);
	void setStartTime(QTime setStartTime);
	void setEndTime(QTime setEndTime);
	void addTag(QString setTag);

	//Getters for different task parameters
	TaskType getTaskType() const;
	int getTaskRef() const;
	QString getTitle() const;
	QDateTime getStartDateTime() const;
	QDateTime getEndDateTime() const;
	QDate getTaskDate() const;
	QTime getTaskTime() const;
	QDate getStartDate() const;
	QTime getStartTime() const;
	QDate getEndDate() const;
	QTime getEndTime() const;
	QVector<QString> getAllTags() const;
	TaskStatus getTaskStatus();
	
	//Functions that update the task status and task type variables
	void updateTaskType();
	void updateTaskStatus();
	void markComplete();
	void unmarkComplete();

	//Functions that handle tags
	bool isTag(QString tag);
};

#endif